package com.ft.oa.web.bidproject;


import com.ft.oa.domain.dto.ApiResult;
import com.ft.oa.domain.project.BidProject;
import com.ft.oa.domain.project.BidProjectPage;
import com.ft.oa.enums.ResultCode;
import com.ft.oa.enums.TenderResult;
import com.ft.oa.service.project.BidProjectService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;


/**
 * 招投标管理接口
 * @author liyansheng
 * @ClassName BidProjectController
 * @date 2022-1-5 16:09:29
 */
@RestController
@RequestMapping("/bid")
public class BidProjectController {

    @Resource
    private BidProjectService bidProjectService;

    /**
     * 新增招投标项目
     * @param bid
     * @return
     */
    @PostMapping("/add")
    public ApiResult addBipProject(@RequestBody BidProject bid){
        ApiResult result = bidProjectService.add(bid);
        return result;
    }

    /**
     * 根据主键查询招投标项目
     * @param id
     * @return
     */
    @PostMapping("/select/{id}")
    public ApiResult selectById(@PathVariable Long id){
        ApiResult result = bidProjectService.selectById(id);
        return result;
    }

    /**
     * 编辑招投标项目
     * @param bid
     * @return
     */
    @PostMapping("/edit")
    public ApiResult editBipProject(@RequestBody BidProject bid){
        ApiResult result = bidProjectService.edit(bid);
        return result;
    }

    /**
     * 删除招投标项目
     * @param id
     * @return
     */
    @PostMapping("/del/{id}")
    public ApiResult delBipProject(@PathVariable Long id){
        ApiResult result = bidProjectService.del(id);
        return result;
    }

    /**
     * 修改招投标结果
     * @param  、bidResult
     * @return
     */
    @PostMapping("/change")
    public ApiResult changeBidResult(@RequestBody BidProjectPage bidpage){
        ApiResult result = bidProjectService.changeBidResult(bidpage);
        return result;
    }
    /**
     * 修改审核状态
     */
    @PostMapping("/approvalstatus")
    public ApiResult approvalstatus(@RequestBody BidProjectPage bidpage ){
        return ApiResult.successWithData(bidProjectService.approvalstatus(bidpage));
    }
    /**
     * 招投标分页查询
     * @return
     */
    @PostMapping("/page")
    public ApiResult page(@RequestBody BidProjectPage bidpage){
        ApiResult result = bidProjectService.page(bidpage);
        return result;
    }
}
